package com.zgm.ch06.aop.aspectJ.advice.before._2_5_1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.zgm.ch06.aop.services.StockService;
import com.zgm.ch06.aop.services.UserService;

public class BeforeDemo {

	public static void main(String[] args) {
		ApplicationContext ac = new ClassPathXmlApplicationContext("com/zgm/ch06/aop/aspectJ/advice/before/_2_5_1/_2_5_1-context.xml");
		
		StockService stockService = (StockService) ac.getBean("stockService"); 
//		
//		System.out.println(stockService.getStockLevel("ABC"));
		
		UserService userService = (UserService) ac.getBean("userService");
		userService.login("zgm");
		System.out.println(stockService.getStockLevel("EFG"));
	}
}
